package com.dhy.commadstate.util;

import java.io.Serializable;

public class MyCommand implements Serializable {
    public MyCommand(String commandString) {
        String[] d = commandString.split(split);
        this.name = d[0];
        this.log = d[1].equals("true");
        this.code = Integer.parseInt(d[2]);
        this.testing = d[3].equals("true");
    }
    public MyCommand(String name,int code,boolean log,boolean testing) {
        this.log = log;
        this.code = code;
        this.name = name;
        this.testing = testing;
    }
    public int code;
    public String name;
    public boolean log;
    public boolean testing;
    public static final String split = ":";

    @Override
    public String toString() {
        return name + split + log + split + code + split + testing;
    }
}
